﻿<%@ Page Title="" Language="C#" MasterPageFile="../Share/Default.master" AutoEventWireup="true"
    CodeFile="Field.aspx.cs" Inherits="Role_Field" %>

<%@ Register Assembly="ClickOnceButton" Namespace="FreeHouse.Web.Controls" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">

    <script src="../js/jquery-1.4.2.min.js" type="text/javascript"></script>

    <script src="../js/fields.js" type="text/javascript"></script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="body" runat="Server">
    <table>
        <tr>
            <td>
                <asp:GridView ID="models" runat="server" AutoGenerateColumns="false" OnRowDataBound="actionClass_RowDataBound">
                    <Columns>
                        <asp:TemplateField>
                            <HeaderTemplate>
                                用户Action 权限
                            </HeaderTemplate>
                            <ItemTemplate>
                                <table>
                                    <tr>
                                        <th>
                                            <input class="model" id="actionClass<%#Eval("ModelId") %>" type="checkbox" value="<%#Eval("ModelId") %>" />
                                            <label for="model<%#Eval("ModelId") %>">
                                                <%#Eval("ModelName")%></label>
                                            说明:
                                            <%#Eval("Description") %>
                                        </th>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:Localize ID="nodata" runat="server"></asp:Localize>
                                            <asp:Repeater ID="fields" runat="server">
                                                <ItemTemplate>
                                                    <input name="action" id="action<%#Eval("FieldId") %>" type="checkbox" value="<%#Eval("FieldId") %>"
                                                        <%#roleFields.Find(delegate(FreeHouse.Model.TRoleField model) { return model.FieldsId.ToString() == Eval("FieldId").ToString(); }) != null ? "checked=\"checked\"" : ""%> />
                                                    &nbsp;
                                                    <label for="action<%#Eval("FieldId") %>" title="<%#Eval("Description") %>">
                                                        <%#Eval("FieldName")%></label>
                                                </ItemTemplate>
                                            </asp:Repeater>
                                        </td>
                                    </tr>
                                </table>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <EmptyDataTemplate>
                        暂无Action.
                    </EmptyDataTemplate>
                </asp:GridView>
            </td>
        </tr>
        <tr>
            <td>
                <cc1:ClickOnceButton ID="save" runat="server" Text="保存" AfterSubmitText="正在处理,请稍后..."
                    Width="65px" OnClick="save_Click" />
                &nbsp;<cc1:ClickOnceButton ID="back" runat="server" Text="返回" AfterSubmitText="正在处理,请稍后..."
                    Width="65px" OnClick="back_Click" />
            </td>
        </tr>
    </table>
</asp:Content>
